import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { Base } from '../base.entity';

@Entity()
export class UserPermission extends Base {

  //权限名称
  @Column({ length: 30, comment: '权限名称' })
  permission_name: string;

  //父集ID
  @Column({ default: 0, comment: '父集ID' })
  parent_id: number;

  //权限
  @Column({ length: 50, comment: '权限', default: 'sure' })
  permission_key: string;

  //图标
  @Column({ length: 50, comment: '权限', default: 'menu' })
  permission_icon: string;

  //权限路径
  @Column({ length: 200, comment: '权限路径' })
  permission_url: string;

  //路径参数
  @Column({ length: 200, comment: '路径参数', nullable: true })
  permission_parameter: string;

  //权限类型
  @Column({ comment: '权限类型' })
  permission_type: number;

  //排序
  @Column({ type: 'float', comment: '排序', default: 100 })
  permission_sort: number;

  //是否启用
  @Column({ default: 1, comment: '是否启用' })
  permission_isactive: number;

  //描述
  @Column({ length: 30, nullable: true, comment: '描述' })
  permission_describe: string;

  //创建人user_id
  @Column({ comment: '创建人user_id', nullable: true })
  user_id: number;


}